#include <iostream>
#include <stdio.h>
using namespace std;

class A{
public:

    A(int a=0)
    {
    	this->a=a;
    }
    //+
    A operator+(A &a1)
    {
    	A temp;
    	temp.a=this->a+a1.a;
    	return temp;
    }
    //前置++
    A operator++()
    {
    	this->a++;
    	return *this;
    }
    //后置--
    A operator--(int)	
    {
     	return *this;
     	this->a--;
    }
    	
    void getA()
    {
    	printf("%d\n",a);
    }
public:
	int a;	
};

A operator-(A &a1,A &a2)
{
    a1.a=a1.a-a2.a;
    return a1;
}
//前置--
A &operator--(A &a1)
{
	a1.a--;
    return a1;
}
//后置++
A &operator++(A &a1,int)
{
    return a1;
    a1.a++;
}

int main()
{
	A aa(1);
    A cc(2);
    A bb;
    A dd;

    ++aa;
    aa.getA(); //2

    cc.operator--(0);
    cc.getA(); //2

    bb=aa+cc;
    bb.getA(); //4

    dd=operator-(cc,aa);
    dd.getA(); //0

	return 0;
}
